Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Fix torus normals #3549

Closed
wants to merge 1 commit into from

Conversation

rparrett
Copy link
Contributor

@rparrett rparrett commented Jan 4, 2022

Objective

Fixes #3547

Solution

Normal calc adapted from https://web.cs.ucdavis.edu/~amenta/s12/findnorm.pdf

Before

before

After

after

I'm assuming that the greyness and the self-shadowing artifacts are... normal for the new renderer.

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Jan 4, 2022
@cart
Copy link
Member

cart commented Jan 4, 2022

Nice work! The greyness is (i think) an expected effect from highly reflective surfaces (notice a similar effect at the bottom of the red sphere in this Filament render). Increasing the perceptual_roughness should make it go away. Shadow artifacts are hard to avoid in all cases. That will be a constant battle I think 😄

@cart
Copy link
Member

cart commented Jan 4, 2022

bors r+

bors bot pushed a commit that referenced this pull request Jan 4, 2022
# Objective

Fixes #3547 

## Solution

Normal calc adapted from https://web.cs.ucdavis.edu/~amenta/s12/findnorm.pdf

## Before
<img width="1392" alt="before" src="https://user-images.githubusercontent.com/200550/148125212-fb1c083e-3c57-4330-a656-df34513c36ab.png">

## After
<img width="1392" alt="after" src="https://user-images.githubusercontent.com/200550/148125223-174dc956-37df-4ac2-8983-b18e1e2a9a7d.png">

I'm assuming that the greyness and the self-shadowing artifacts are... normal for the new renderer.
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior and removed S-Needs-Triage This issue needs to be labelled labels Jan 4, 2022
@alice-i-cecile
Copy link
Member

Nice work, thanks!

@Sebbl0508
Copy link

Very cool, thanks!

@bors bors bot changed the title Fix torus normals [Merged by Bors] - Fix torus normals Jan 4, 2022
@bors bors bot closed this Jan 4, 2022
@HackerFoo
Copy link
Contributor

HackerFoo commented Jan 5, 2022

The artifacts in the shadow are likely due to the resolution of the shadow map - notice the pixelation in the shadows. For example, here's what a torus looks like in my app (using the new renderer):

IMG_03C88D6283DB-1

bors bot pushed a commit that referenced this pull request Apr 26, 2022
# Objective

Fix wonky torus normals.

## Solution

I attempted this previously in #3549, but it looks like I botched it. It seems like I mixed up the y/z axes. Somehow, the result looked okay from that particular camera angle.

This video shows toruses generated with
- [left, orange] original torus mesh code
- [middle, pink] PR 3549
- [right, purple] This PR

https://user-images.githubusercontent.com/200550/164093183-58a7647c-b436-4512-99cd-cf3b705cefb0.mov
exjam pushed a commit to exjam/bevy that referenced this pull request May 22, 2022
# Objective

Fix wonky torus normals.

## Solution

I attempted this previously in bevyengine#3549, but it looks like I botched it. It seems like I mixed up the y/z axes. Somehow, the result looked okay from that particular camera angle.

This video shows toruses generated with
- [left, orange] original torus mesh code
- [middle, pink] PR 3549
- [right, purple] This PR

https://user-images.githubusercontent.com/200550/164093183-58a7647c-b436-4512-99cd-cf3b705cefb0.mov
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

Fix wonky torus normals.

## Solution

I attempted this previously in bevyengine#3549, but it looks like I botched it. It seems like I mixed up the y/z axes. Somehow, the result looked okay from that particular camera angle.

This video shows toruses generated with
- [left, orange] original torus mesh code
- [middle, pink] PR 3549
- [right, purple] This PR

https://user-images.githubusercontent.com/200550/164093183-58a7647c-b436-4512-99cd-cf3b705cefb0.mov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Weird looking Torus with
5 participants